package com.zhuangjie.mvc.validator.annotate;

import com.zhuangjie.mvc.validator.handler.PhoneNumberConstraintValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented
@Constraint(validatedBy = {PhoneNumberConstraintValidator.class})
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
public @interface PhoneNumber {
    // 拷贝其它检验注解的1
    String message() default "手机号格式错误";
    // 拷贝其它检验注解的2
    Class<?>[] groups() default {};
    // 拷贝其它检验注解的3
    Class<? extends Payload>[] payload() default {};

    boolean hasAreaCode() default false;
}
